// Copyright Leonid Shlyapnikov 2010
// Distributed under the GNU Lesser General Public License http://www.gnu.org/licenses/lgpl.html
//    author: Leonid Shlyapnikov, created on: Sep 18, 2010

#ifndef FIXPARSER_CPP_SRC_MAIN_FIXPARSER_SIMPLEFIXMESSAGEWRITER_H_
#define FIXPARSER_CPP_SRC_MAIN_FIXPARSER_SIMPLEFIXMESSAGEWRITER_H_

#include <boost/foreach.hpp>

class SimpleFixMessageWriter {
public:
    SimpleFixMessageWriter();
    virtual ~SimpleFixMessageWriter();

    template<class S>
    S* writeTo(S* output) const {
        // don't forget about the required order of fields (check the spec):
        // 8=..|9=..|34=..(??)|35=..(??)| ... 10=..|

//        BOOST_FOREACH(const Field& field, this->fieldList_) {
//            field.writeTo(output);
//        }
//
//        if (false == checksumField_.isEmpty()) {
//            checksumField_.writeTo(output);
//        }

        return output;
    }
};

#endif  // FIXPARSER_CPP_SRC_MAIN_FIXPARSER_SIMPLEFIXMESSAGEWRITER_H_
